<!DOCTYPE html>
<html>
<head>
    <title>二维码生成查看</title>
    #parse("sys/header.html")
    <script>
        var devId = getQueryString("devId");
        $(function () {
            var nameplate = getQueryString('nameplate')
            if(nameplate){
                vm.liveImage = nameplate
            }else{
                dialogLoading(true)
                Ajax.request({
                    url: '../deviceinfo/loadDevNameplate?devId='+devId,
                    type: 'GET',
                    successCallback: function (res) {
                        dialogLoading(false)
                        vm.liveImage = res.nameplateUrl
                    }
                });
            }
        });

    </script>
    <style>
        .box{
            width: 100%;
            height: 100%;
        }
        .box ul{
            height: 300px;
            display: flex;
            flex-direction: column;
            justify-content: center;
            text-align: center;
        }

        .box ul li{
            list-style: none;
            margin: 0 auto;
            text-align: center;
        }
        .refresh{
            position: absolute;
            top: 10px;
            left: 20px;
        }
    </style>
</head>
<body style="text-align:center;">
<div class="box" id="qrcode">
    <div class="refresh">
        <i-button type="info" @click="reload"><i class="fa fa-refresh"></i>&nbsp;刷新</i-button>
    </div>
   <div style="display: flex;justify-content: center;padding-top: 30px">
       <image :src="liveImage" style="width: auto;height: 400px" />
   </div>
</div>
</body>
<script>
    var vm = new Vue({
        el:'#qrcode',
        data:{
            liveImage:''
        },
        methods:{
            reload:function (){
                dialogLoading(true)
                Ajax.request({
                    url: '../deviceinfo/loadDevNameplate?devId='+devId+'&isReset=1',
                    type: 'GET',
                    successCallback: function (res) {
                        dialogLoading(false)
                        vm.liveImage = res.nameplateUrl
                    }
                });
            }
        }
    })
</script>
</html>
